import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


# headers = {
#     "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
#     # "Referer": "https://book.douban.com/",  # 有些网站要求 Referer
#     "Referer": "https://localhost:5001/",  # 有些网站要求 Referer
#     "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
# }


headers = {
    "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOiIxNzQ5MTA3MzgyIiwiZXhwIjoxNzQ5MTkzNzgyLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiMUIzMDU4QzgtN0ZCMS00Q0Y1LUIzNTItNENBMjAwNUU5OEE3IiwiaXNzIjoiUmF5ZXJ0ZWNoLkRNUyIsImF1ZCI6IlJheWVydGVjaCBHcm91cCJ9.BhPFZiL6OyjQrj6W9MXk2PhoHOBCRfIER6QXSYUSGyA",  # 常用格式：Bearer <token>
    "Content-Type": "application/json",         # 按需添加其他头
}



# response = requests.get(url='http://yushu.talelin.com',verify=False)
# response = requests.get(url='https://read.douban.com/category/236?sort=hot&page=2',headers=headers)
# response = requests.get(url='http://127.0.0.1:8042/patients/')
# 需要配置Authorization 才可以访问
response = requests.get(url='https://localhost:5001/dms/machines/allbypage/',headers=headers, verify=False)
# response = requests.get(url='http://localhost:8080/Patient/Patients',headers=headers, verify=False)
print(response.text)
# print(response.status_code)
# print(response.json())